package com.exam.api.modules.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 用户表实体类
 *
 * @author bcheng
 */
@Schema(description="用户表")
@Data
@TableName(value = "tbl_user")
public class TblUser implements Serializable {
    /**
     * 用户id
     */
    @Schema(description = "用户id")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    @NotNull(message = "用户id不能为null")
    private Long userId;

    /**
     * 部门id
     */
    @Schema(description = "部门id")
    @TableField(value = "dept_id")
    @NotNull(message = "部门id不能为null")
    private Long deptId;

    /**
     * 工号
     */
    @Schema(description = "工号")
    @TableField(value = "job_no")
    @Size(max = 50,message = "工号最大长度要小于 50")
    private String jobNo;

    /**
     * 昵称
     */
    @Schema(description = "昵称")
    @TableField(value = "nick_name")
    @Size(max = 15,message = "昵称最大长度要小于 15")
    private String nickName;

    /**
     * 真实名字
     */
    @Schema(description = "真实名字")
    @TableField(value = "real_name")
    @Size(max = 15,message = "真实名字最大长度要小于 15")
    private String realName;

    /**
     * 头像
     */
    @Schema(description = "头像")
    @TableField(value = "avatar_url")
    @Size(max = 255,message = "头像最大长度要小于 255")
    private String avatarUrl;

    /**
     * 我的二维码
     */
    @Schema(description = "我的二维码")
    @TableField(value = "qrcode")
    @Size(max = 150,message = "我的二维码最大长度要小于 150")
    private String qrcode;

    /**
     * 性别  0 男 1 女 2 其他
     */
    @Schema(description = "性别  0 男 1 女 2 其他")
    @TableField(value = "gender")
    @Size(max = 10,message = "性别  0 男 1 女 2 其他最大长度要小于 10")
    private String gender;

    /**
     * 性别是否显示 0显示 1隐藏
     */
    @Schema(description = "性别是否显示 0显示 1隐藏")
    @TableField(value = "gender_show")
    @NotNull(message = "性别是否显示 0显示 1隐藏不能为null")
    private Boolean genderShow;

    /**
     * 生日
     */
    @Schema(description = "生日")
    @TableField(value = "birthday")
    private LocalDate birthday;

    /**
     * 个性签名
     */
    @Schema(description = "个性签名")
    @TableField(value = "signature")
    @Size(max = 50,message = "个性签名最大长度要小于 50")
    private String signature;

    /**
     * 地区
     */
    @Schema(description = "地区")
    @TableField(value = "region")
    @Size(max = 50,message = "地区最大长度要小于 50")
    private String region;

    /**
     * 地区是否显示 0显示 1隐藏
     */
    @Schema(description = "地区是否显示 0显示 1隐藏")
    @TableField(value = "region_show")
    @NotNull(message = "地区是否显示 0显示 1隐藏不能为null")
    private Boolean regionShow;

    /**
     * 区号
     */
    @Schema(description = "区号")
    @TableField(value = "zone_code")
    @Size(max = 6,message = "区号最大长度要小于 6")
    @NotBlank(message = "区号不能为空")
    private String zoneCode;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    @TableField(value = "tel")
    @Size(max = 20,message = "手机号最大长度要小于 20")
    @NotBlank(message = "手机号不能为空")
    private String tel;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    @TableField(value = "email")
    @Size(max = 50,message = "邮箱最大长度要小于 50")
    @NotBlank(message = "邮箱不能为空")
    private String email;

    /**
     * 密码
     */
    @Schema(description = "密码")
    @TableField(value = "`password`")
    @Size(max = 100,message = "密码最大长度要小于 100")
    private String password;

    /**
     * 用户权重
     */
    @Schema(description = "用户权重")
    @TableField(value = "weight")
    @NotNull(message = "用户权重不能为null")
    private Long weight;

    /**
     * 状态 0 正常 1 停用 2 删除
     */
    @Schema(description = "状态 0 正常 1 停用 2 删除")
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 是否删除
     */
    @Schema(description = "是否删除")
    @TableField(value = "is_delete")
    @TableLogic
    private Integer isDelete;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @TableField(value = "`comment`")
    @Size(max = 50,message = "备注最大长度要小于 50")
    private String comment;

    /**
     * 禁用备注
     */
    @Schema(description = "禁用备注")
    @TableField(value = "forbidden_comment")
    @Size(max = 50,message = "禁用备注最大长度要小于 50")
    private String forbiddenComment;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @Serial
    @Schema(hidden = true)
    private static final long serialVersionUID = 1L;
}
